package com.sztx.pay.center.dataaccess.dao.mysql;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.sztx.pay.center.dataaccess.domain.OrderRechargeDO;
import com.sztx.pay.center.dataaccess.domain.OrderRechargeDumpDO;
import com.sztx.pay.center.dataaccess.entity.QueryOrder;
import com.sztx.se.dataaccess.mysql.BaseMysqlDAO;
import com.sztx.se.dataaccess.mysql.config.PageQuery;

public interface OrderRechargeMysqlDAO extends BaseMysqlDAO<OrderRechargeDO> {
    
	Integer save(OrderRechargeDO orderRechargeDO);
	  
	void delete(@Param("rechargeOrderId") String rechargeOrderId);
  
	int update(OrderRechargeDO orderRechargeDO);
  
	OrderRechargeDO findById(@Param("rechargeOrderId") String rechargeOrderId);
  
	OrderRechargeDO findByIdForSchedule(@Param("rechargeOrderId") String rechargeOrderId);
	
	OrderRechargeDO findByOrderId(@Param("orderId") String orderId);
	
	String getLastChargeBindNo(@Param("userId") String userId);

	OrderRechargeDO findOrderByPayParams(@Param("orderId")String orderId,@Param("amount") int amount,@Param("payerUserId") String payerUserId,@Param("bankId") String bankId);

	
	List<OrderRechargeDO> findQuery(@Param("query") QueryOrder query, @Param("pageQuery") PageQuery pageQuery);
	
	Integer totalCount(QueryOrder queryOrder);
	
	Integer dumpCount(@Param("startTime") String startTime, @Param("endTime") String endTime);
	
	List<OrderRechargeDumpDO> findUnHandleForSchedule(@Param("taskItemNum") Integer taskItemNum, @Param("taskItems") List<String> taskItems, @Param("fetchNum") Integer fetchNum, @Param("startTime") String startTime, @Param("endTime") String endTime);
	
	int updateHandleForSchedule(@Param("tradeOrderId") String tradeOrderId, @Param("oldStatus") List<Integer> oldStatus, @Param("newStatus") Integer newStatus, @Param("num") Integer num);
	
	void deleteDumpCount(@Param("startTime") String startTime, @Param("endTime") String endTime);
	
	int batchUpdateHandleForSchedule(@Param("tradeOrderIds") List<String> tradeOrderIds, @Param("oldStatus") List<Integer> oldStatus, @Param("newStatus") Integer newStatus, @Param("num") Integer num);
}
  
